export default function(menusRouter, puzzleName) {
  let router = [];
  let arr = [];

  // 动态路由
  for (let item of menusRouter)
    if(item.leaf){
      router.push({
        name: item.label,
        path: item.component,
        component: () =>
            import(
              /* webpackChunkName: "views/[request]" */
                 `@/puzzles${item.component}`
                ),
        meta: {
          puzzleName: puzzleName,
          name: item.name,
          resource: item.resource ? item.resource : []
        }
      });
    }
  return router;
}
